<%
var headerPart = {
%>
<style>
	html{background-color: #fff!important;}
</style>
<% }; %>
<% layout("/layouts/micro.html",{headerSection:headerPart}){ %>
<div class="childrenBody">
    <div class="layui-tab-content">
	<form id="inputForm" action="${ctx}/sys/office/save" method="post" class="layui-form">
		<input type="hidden" name="id" value="${office.id}"/>
		<#message content="${message!}"/>
		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label">归属区域:</label>
				<div class="layui-input-block">
					<#treeselect id="area" name="area.id" value="${office.area.id!}" labelName="area.name" labelValue="${office.area.name!}"
					title="区域" url="/sys/area/treeData" cssClass="input-midlle"  />
				</div>
			</div>
			
			<div class="layui-col-md6">
				<label class="layui-form-label">上级机构:</label>
				<div class="layui-input-block">
					<#treeselect id="office" name="parent.id" value="${office.parent.id!}" labelName="parent.name" labelValue="${office.parent.name!}"
					title="机构" url="/sys/office/treeData" extId="${office.id}" cssClass="" allowClear="${office.currentUser.admin!}"/>
				</div>
			</div>
		</div>
		
		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label">组织名称:</label>
				<div class="layui-input-block">
					<input type="text" name="name" value="${office.name}" htmlEscape="false" maxlength="50" class="layui-input " lay-verify="required" />
				</div>			
			</div>
			
		</div>
		
		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label">组织编码:</label>
				<div class="layui-input-inline">
					<input type="text" name="code" value="${office.code}" htmlEscape="false" maxlength="50" class="layui-input" lay-verify="required" />
				</div>		
				<div class="layui-form-mid "><font color="red">*</font> </div>
			</div>
			
		</div>
		
		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label">主负责人:</label>
				<div class="layui-input-inline">
					<#treeselect id="primaryPerson" name="primaryPerson.id" value="${office.primaryPerson.id!}" labelName="office.primaryPerson.name!" labelValue="${office.primaryPerson.name!}"
					title="用户" url="/sys/office/treeData?type=3"  allowClear="true" notAllowSelectParent="true"/>
			</div>
			</div>
			
			<div class="layui-col-md6">
				<label class="layui-form-label">副负责人:</label>
				<div class="layui-input-inline">
				 <#treeselect id="deputyPerson" name="deputyPerson.id" value="${office.deputyPerson.id!}" labelName="office.deputyPerson.name!" labelValue="${office.deputyPerson.name!}"
					title="用户" url="/sys/office/treeData?type=3"   notAllowSelectParent="true"/>
				</div>
			</div>
		</div>
		
		<div class="layui-row layui-col-space10 layui-form-item">
           <div class="layui-col-md4">
				<label class="layui-form-label">组织类型:</label>
				<div class="layui-input-block">					
				<select name="type" class="input-medium">
					<option value="" label="请选择"/>
					<#options items="${@DictUtils.getDictList('sys_office_type')}" value="${office.type}"/>
				</select>
				</div>
			</div>
			<div class="layui-col-md4">
				<label class="layui-form-label">组织级别:</label>
				<div class="layui-input-block">
				<select name="grade" class="input-medium">
					<option value="" label="请选择"/>
					<#options items="${@DictUtils.getDictList('sys_office_grade')}" value="${office.grade}"/>
				</select>
				</div>
			</div>
			<div class="layui-col-md4">
				<label class="layui-form-label">是否可用:</label>
				<div class="layui-input-block">
					<#radio name="useable" value="${office.useable }" items="${@DictUtils.getDictList('yes_no')}"/>
				</div>
			</div>
		</div>
		<div class="layui-row layui-col-space10 layui-form-item">
           <div class="layui-col-md4">
				<label class="layui-form-label">联系地址:</label>
				<div class="layui-input-block">
					<input type="text" name="address" value="${office.address}" htmlEscape="false" maxlength="50"  class="layui-input"/>
				</div>
			</div>
			<div class="layui-col-md4">
				<label class="layui-form-label">邮政编码:</label>
				<div class="layui-input-block">
					<input type="text" name="zipCode" value="${office.zipCode}" htmlEscape="false" maxlength="50"  class="layui-input"/>
				</div>
			</div>
		</div>
		<div class="layui-row layui-col-space10 layui-form-item">
           <div class="layui-col-md4">
				<label class="layui-form-label">电话:</label>
				<div class="layui-input-block">
					<input type="text" name="phone" value="${office.phone}" htmlEscape="false" maxlength="50"  class="layui-input"/>
				</div>
			</div>
			<div class="layui-col-md4">
				<label class="layui-form-label">传真:</label>
				<div class="layui-input-block">
					<input type="text" name="fax" value="${office.fax}" htmlEscape="false" maxlength="50"  class="layui-input"/>
				</div>
			</div>
			<div class="layui-col-md4">
				<label class="layui-form-label">邮箱:</label>
				<div class="layui-input-block">
					<input type="text" name="email" value="${office.email}"  htmlEscape="false" maxlength="18"  class="layui-input"/>
				</div>
			</div>
		</div>
		

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">备注:</label>
			<div class="layui-input-block">
				<textarea name="remarks" htmlEscape="false" rows="3" maxlength="200" class="layui-textarea">${office.remarks}</textarea>
			</div>
		</div>
		
        <div class="layui-form-item layui-hide">
		    <div class="layui-input-block">
		      <button class="layui-btn" lay-filter="officeForm" id="officeForm" lay-submit>保 存</button>
		    </div>
	  	</div>
	</form>
	</div>
</div>
<script>
    layui.use(['form','laydate'], function(){
        var form = layui.form,laydate = layui.laydate;
        form.render();
    });
</script>
<%}%>